<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:forgeview="http://jboss.org/forge/view"	
	template="/resources/templates/pageTemplate.xhtml">

	<f:metadata>
		<f:viewParam name="id" value="#{sysBranchBean.id}"/>
		<f:event type="preRenderView" listener="#{sysBranchBean.retrieve}"/>
	</f:metadata>

	<ui:param name="pageTitle" value="Create Sys Branch"/>

	<ui:define name="header">
		Sys Branch
	</ui:define>

	<ui:define name="subheader">
		<c:choose>
			<c:when test="#{!empty sysBranchBean.id}">
				Edit existing Sys Branch
			</c:when>
			<c:otherwise>
				Create a new Sys Branch
			</c:otherwise>
		</c:choose>
	</ui:define>

	<ui:define name="footer"/>

	<ui:define name="main">
		<h:form id="create">
			<h:messages globalOnly="true" styleClass="error"/>

			<h:panelGrid columnClasses="label,component,required" columns="3">
				<h:outputLabel for="sysBranchBeanSysBranchHrEmp" value="Hr Emp:"/>
				<h:panelGroup>
					<h:selectOneMenu converter="#{hrEmpBean.converter}" id="sysBranchBeanSysBranchHrEmp" value="#{sysBranchBean.sysBranch.hrEmp}">
						<f:selectItem/>
						<f:selectItems itemLabel="#{forgeview:display(_item)}" itemValue="#{_item}" value="#{hrEmpBean.all}" var="_item"/>
					</h:selectOneMenu>
					<h:message for="sysBranchBeanSysBranchHrEmp" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="sysBranchBeanSysBranchBranchCode" value="Branch Code:"/>
				<h:panelGroup>
					<h:inputText id="sysBranchBeanSysBranchBranchCode" maxLength="4" required="true" value="#{sysBranchBean.sysBranch.branchCode}"/>
					<h:message for="sysBranchBeanSysBranchBranchCode" styleClass="error"/>
				</h:panelGroup>
				<h:outputText value="*"/>
				<h:outputLabel for="sysBranchBeanSysBranchBranchName" value="Branch Name:"/>
				<h:panelGroup>
					<h:inputText id="sysBranchBeanSysBranchBranchName" maxLength="100" value="#{sysBranchBean.sysBranch.branchName}"/>
					<h:message for="sysBranchBeanSysBranchBranchName" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="sysBranchBeanSysBranchAddr1" value="Addr 1:"/>
				<h:panelGroup>
					<h:inputText id="sysBranchBeanSysBranchAddr1" maxLength="50" value="#{sysBranchBean.sysBranch.addr1}"/>
					<h:message for="sysBranchBeanSysBranchAddr1" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="sysBranchBeanSysBranchAddr2" value="Addr 2:"/>
				<h:panelGroup>
					<h:inputText id="sysBranchBeanSysBranchAddr2" maxLength="50" value="#{sysBranchBean.sysBranch.addr2}"/>
					<h:message for="sysBranchBeanSysBranchAddr2" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="sysBranchBeanSysBranchAddr3" value="Addr 3:"/>
				<h:panelGroup>
					<h:inputText id="sysBranchBeanSysBranchAddr3" maxLength="50" value="#{sysBranchBean.sysBranch.addr3}"/>
					<h:message for="sysBranchBeanSysBranchAddr3" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="sysBranchBeanSysBranchAddr4No" value="Addr 4No:"/>
				<h:panelGroup>
					<h:inputText id="sysBranchBeanSysBranchAddr4No" value="#{sysBranchBean.sysBranch.addr4No}"/>
					<h:message for="sysBranchBeanSysBranchAddr4No" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="sysBranchBeanSysBranchAddr5" value="Addr 5:"/>
				<h:panelGroup>
					<h:inputText id="sysBranchBeanSysBranchAddr5" maxLength="10" value="#{sysBranchBean.sysBranch.addr5}"/>
					<h:message for="sysBranchBeanSysBranchAddr5" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="sysBranchBeanSysBranchPhoneNo" value="Phone No:"/>
				<h:panelGroup>
					<h:inputText id="sysBranchBeanSysBranchPhoneNo" maxLength="10" value="#{sysBranchBean.sysBranch.phoneNo}"/>
					<h:message for="sysBranchBeanSysBranchPhoneNo" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
			</h:panelGrid>

			<div class="buttons">
				<h:commandLink value="Save" action="#{sysBranchBean.update}" styleClass="btn btn-primary"/>
				<c:choose>
					<c:when test="#{!empty sysBranchBean.id}">
						<h:link value="Cancel" outcome="view" styleClass="btn btn-primary">
							<f:param name="id" value="#{sysBranchBean.id}"/>
						</h:link>
						<h:commandLink value="Delete" action="#{sysBranchBean.delete}" styleClass="btn btn-primary"/>
					</c:when>
					<c:otherwise>
						<h:link value="Cancel" outcome="search" styleClass="btn btn-primary"/>
					</c:otherwise>
				</c:choose>
			</div>
		</h:form>
	</ui:define>

</ui:composition>